{template 'common/header'}
{template 'nav'}
{if $op == 'list'}
<div class="panel panel-default">
	<div class="panel-heading">筛选</div>
	<div class="panel-body">
		<form action="./index.php" method="get" class="form-horizontal" role="form" id="form1">
			<input type="hidden" name="c" value="site" />
			<input type="hidden" name="a" value="entry" />
			<input type="hidden" name="m" value="meepo_xianchang" />
			<input type="hidden" name="do" value="redpack_record" />
            <input type="hidden" name="rotate_id" value="{$rotate_id}" />
            <input type="hidden" name="id" value="{$id}" />
			<input type="hidden" name="money" value="{$money}" />
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">粉丝昵称</label>
				<div class="col-xs-12 col-sm-8 col-lg-8">
					<input class="form-control" name="nickname" id="" type="text" value="{$_GPC['nickname']}" placeholder="请输入粉丝昵称">
				</div>
			</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label"></label>
				<div class="col-sm-8 col-lg-9 col-xs-12">
					<input class="btn btn-primary" id="" type="submit" value="搜索">
				</div>
			</div>
		</form>
	</div>
</div>
<form action="" method="post" class="form-horizontal" role="form" ng-controller="formCtrl" id="form2">
	<div class="panel panel-default">
		<div class="panel-heading">
			        <div class="navbar navbar-default navbar-static-top">
					  <div class="container-fluid" style="background-color: rgb(238, 238, 238);padding:0px;margin:0px;">
					  <div class="btn-group">
								<a class="btn btn-default" href="{php echo $this->createWebUrl('redpack_manage', array('id' => $id))}">返回轮数列表</a>
					  </div>
					   <div class="btn-group">
								<a class="btn {if empty($money)}btn-success{else}btn-default{/if}" href="{php echo $this->createWebUrl('redpack_record', array('id' => $id,'rotate_id'=>$rotate_id))}">全部名单</a>
					  </div>
					  <div class="btn-group">
								<a class="btn {if empty($money)}btn-default{else}btn-success{/if}" href="{php echo $this->createWebUrl('redpack_record', array('id' => $id,'rotate_id'=>$rotate_id,'money'=>'0.0'))}">中奖记录</a>
					  </div>
					  <div class="btn-group">
								<a class="btn btn-default" href="{php echo $this->createWebUrl('redpack_record', array('id' => $id,'rotate_id'=>$rotate_id,'op'=>'reset'))}" onclick="return confirm('清空将无法恢复，确认吗？');return false;">清空本轮记录</a>
					  </div>
					  </div>
					</div>
		</div>
		<div class="panel-body table-responsive">
			<table class="table table-hover" style="display:auto;">
				<thead class="navbar-inner">
					<tr >
					   <th style="width:5em;text-align:center" >选？</th>
					   <th style="width:10em;text-align:center">粉丝信息</th>
					   <th style="width:20em;text-align:center">红包金额</th>
					   <th style="width:18em;text-align:center">时间</th>
                       <th style="width:15em;text-align:center">操作</th>
					</tr>
				</thead>
				<tbody>
					{loop $lists $key $item}
					<tr>
						<td><input type="checkbox" name="select[]" value="{php echo $item['id']}"></td>
						
					  	<td class="row-hover" style="text-align:center">
								<img width="50" src="{$item['avatar']}" class="avatar" />
								<div class="mainContent">
									<div class="nickname" style="text-align:center">{$item['nick_name']}</div>
								</div>
					    </td>
						<td class="row-hover" style="text-align:center">
							{if $item['money']=='0.0'}未中奖{else}{$item['money']}元{/if}
					    </td>
						<td class="row-hover" style="text-align:center">
							{php echo date('Y-m-d H:i:s',$item['createtime']);}
					    </td>
						<td style="text-align:center">
							<a class="btn btn-danger" href="{php echo $this->createWebUrl('redpack_record',array('op'=>'del','id'=>$id,'redpack_user_id'=>$item['id'],'rotate_id'=>$rotate_id))}"
								ng-mouseenter="tooltip()" data-toggle="tooltip" data-placement="top" title="删除" onclick="return confirm('删除将无法恢复，确认吗？');return false;">删除
								<i class="fa fa-times"></i>
							</a>

						</td>
					</tr>
					{/loop}
				</tbody>
				<tr>
					<td><input type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});"></td>
                    <td colspan="12">
					<input type="hidden" name="rotate_id" value="{$rotate_id}">
                        <input type="submit" class="btn btn-danger" name="delete" value="删除选定" />
						<input type="submit" class="btn btn-pramary" name="down" value="导出选定数据" />
                        <input type="submit" class="btn btn-pramary" name="downall" value="导出所有数据" />
						<input type="hidden" name="money" value="{$money}">
						<input type="hidden" name="token" value="{$_W['token']}">
                    </td>
				</tr>
			</table>

		</div>
	</div>
</form>
{$pager}
<script>
	require(['angular', 'jquery', 'util'], function(angular, $, util){

		var app = angular.module('app', []);
		app.controller('formCtrl', function($scope,$http){
			$scope.tooltip = function(){
		      $('[data-toggle="tooltip"]').tooltip();
		    }
		});
		angular.bootstrap(document, ['app']);
	});
</script>
{/if}

{template 'common/footer'}
